input=11.mp4
rm mylogo.fifo
mkfifo mylogo.fifo
( echo "RGBA32 151 60 5 5 0 1"; cat mylogo.rgba ) > mylogo.fifo &
sleep 1
echo "=====================================================================1"
/usr/bin/mencoder $input -o /dev/null -passlogfile ./42_temp.log -ovc x264 -x264encopts  \
bitrate=512:turbo=1:frameref=8:mixed_refs:partitions=all:8x8dct:me=umh:subq=6:trellis=2:threads=auto:pass=1 \
-nosound -ofps 29.97 -vf bmovl=0:0:mylogo.fifo,harddup -demuxer mov ;

rm mylogo.fifo
mkfifo mylogo.fifo
( echo "RGBA32 151 60 5 5 0 1"; cat mylogo.rgba ) > mylogo.fifo &
sleep 1
echo "=====================================================================2"
/usr/bin/mencoder  $input -o ./42_temp.264 -passlogfile ./42_temp.log -ovc x264 -x264encopts  \
bitrate=512:frameref=8:mixed_refs:partitions=all:8x8dct:me=umh:subq=6:trellis=2:threads=auto:pass=2 \
-of rawvideo -nosound -ofps 29.97 -vf bmovl=0:0:mylogo.fifo,harddup -demuxer mov
echo "================================================================================3"
/usr/bin/mplayer $input -af resample=48000:0:0,volnorm=1:0.25 -ao pcm:file=42_temp.wav -vc dummy -vo null -demuxer mov
/usr/bin/neroAacEnc -br 48000 -he -if 42_temp.wav -of 42_temp.mp4
/usr/local/bin/MP4Box -add 42_temp.264#video:fps=29.97 42.m4v
/usr/local/bin/MP4Box -add 42_temp.mp4#audio 42.m4v
/usr/local/bin/MP4Box -inter 500 -itags album=na:artist=na:comment=na:created=na:name=na -lang English 42.m4v
